import React from 'react';
import { BrowserRouter as Router, Route, Switch,Redirect } from 'react-router-dom';
import login from './pages/login/login';
import Home from './pages/home/home';
import overview from './pages/overview/overview';
import staff from './pages/staff/staff';
import depart from './pages/depart/depart';
import jurisdiction from './pages/jurisdiction/jurisdiction';
import device from './pages/device/device';
import deviceDetail from './pages/deviceDetail/deviceDetail';

const BasicRoute = () => (
    <Router>
        <Switch>
            <Route path="/login" component={login} />
            <Route path="/" component={() =>
                <Home>
                    <Switch>
                        <Route path="/overview" component={overview} />
                        <Route path="/staff" component={staff} />
                        <Route path="/depart" component={depart} />
                        <Route path="/jurisdiction" component={jurisdiction} />
                        <Route path="/device" exact component={device} />
                        <Route path="/device/deviceDetail/:id" component={deviceDetail} />
                        {/* <Redirect to="/overview"/> */}
                    </Switch>
                </Home>} />
        </Switch>
    </Router>
);
export default BasicRoute;